package tx.oopa.circuit.port;

/**
 * Abstract class representing every possible component in the logical circuit.
 * Inputs, nodes and probes all inherit from this class.
 * 
 * @author Xander van Rijn
 *
 */
public abstract class AbstractComponent {
        
    protected AbstractComponent() {}
    
    protected AbstractComponent(String id) {
        PortFactory.assign(id, this);
    }
    
    public abstract AbstractComponent clone();
    
    public abstract String getID();
    
    /**
     * Set the input value of the logical formula. The return value depends on the 
     * implementation of the method. In default the answer of the formula is returned or
     * null if formula needs more input values.
     * 
     * @param bool
     * @return Formula answer or null if formula cannot yet be executed
     */
    public abstract Boolean setInput(Boolean bool);
}
